<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <!-- Source generators must target netstandard2.0 which doesn't support nullable reference types. In order
         to enable the nullable reference type compiler checks, we also target NetCoreAppToolCurrent. Note that
         this doesn't use the live shared framework but an LKG targeting pack instead to avoid layering concerns. -->
    <TargetFrameworks>$(NetCoreAppToolCurrent);netstandard2.0</TargetFrameworks>
    <AnalyzerRoslynVersion>4.4</AnalyzerRoslynVersion>
    <RoslynApiVersion>$(MicrosoftCodeAnalysisVersion_4_4)</RoslynApiVersion>
    <DefineConstants>$(DefineConstants);ROSLYN4_0_OR_GREATER;ROSLYN4_4_OR_GREATER</DefineConstants>
  </PropertyGroup>

  <Import Project="System.Text.Json.SourceGeneration.targets" />

  <ItemGroup>
    <Compile Include="JsonSourceGenerator.Roslyn4.0.cs" />
  </ItemGroup>

  <ItemGroup>
    <Compile Include="$(CoreLibSharedDir)System\Collections\Generic\ValueListBuilder.cs" Link="Production\ValueListBuilder.cs" />
    <Compile Include="$(CoreLibSharedDir)System\Collections\Generic\ValueListBuilder.Pop.cs" Link="Production\ValueListBuilder.Pop.cs" />
  </ItemGroup>

  <!-- Don't reference System.Text.Json from the LKG, as shared sources are compiled into this project. -->
  <ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppToolCurrent)'">
    <DefaultReferenceExclusion Include="System.Text.Json" />
  </ItemGroup>

</Project>
